from django.db import models
from apps.common.base.models import BaseModel
from  apps.user.models import UserModel

class Payway(BaseModel):

    status = (
        (0, "关闭"),
        (1, "正常"),
    )
    types = (
        ('ali', "支付宝"),
        ('wx', "微信"),
        ('bank', "银行卡"),
    )
    user=models.ForeignKey(UserModel, related_name='user_payway', verbose_name='所属用户', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    realname=models.CharField("真实姓名", max_length=200, blank=True)
    accountName=models.CharField("账号名称", max_length=200, blank=True)
    accountSubName=models.CharField("支行", max_length=200, blank=True)
    account=models.CharField("账号", max_length=200, blank=True)
    bankCode=models.CharField("银行编号", max_length=200, blank=True)
    default=models.BooleanField('是否默认', default=False)
    types = models.CharField("类型", max_length=100, choices=types, null=True, blank=True)
    paywayCodeUrl = models.CharField("收款码", max_length=200, null=True, blank=True)
    status = models.IntegerField("状态", choices=status, default=1)

    class Meta:
        verbose_name = 'Payway'
        verbose_name_plural = verbose_name